home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / misc / frefs11.lha / FetchRefs / Source / GenerateIndex / triton_lib.c < prev   
C/C++ Source or Header  |  1994-07-31  |  2KB  |  104 lines

  1. /*
  2.  *  Triton - The object oriented GUI creation system for the Amiga
  3.  *  Written by Stefan Zeiger in 1993-1994
  4.  *
  5.  *  (c) 1993-1994 by Stefan Zeiger
  6.  *  You are hereby allowed to use this source or parts of it for
  7.  *  creating programs for AmigaOS which use the Triton GUI creation
  8.  *  system. All other rights reserved.
  9.  *
  10.  *  Very slightly modified to compile with DICE. Anders Melchiorsen, 30-May-94
  11.  */
  12.  
  13.  
  14. #define TR_NOMACROS
  15. #define TR_NOSUPPORT
  16.  
  17. #include <clib/exec_protos.h>
  18. #include <libraries/triton.h>
  19. #include <proto/triton.h>
  20.  
  21. /* Support functions */
  22.  
  23. struct Library *TritonBase;
  24. struct TR_App *__Triton_Support_App;
  25.  
  26. /****** triton.lib/TR_OpenTriton ******
  27. *
  28. *   NAME        
  29. *       TR_OpenTriton -- Opens Triton ready to use.
  30. *
  31. *   SYNOPSIS
  32. *       success = TR_OpenTriton(version, tag1,...)
  33. *       D0
  34. *
  35. *       BOOL TR_OpenTriton(ULONG, ULONG,...);
  36. *
  37. *   FUNCTION
  38. *       Opens triton.library with the specified minimum
  39. *       version and creates an application.
  40. *       The supplied tags are passed as a taglist to
  41. *       TR_CreateApp().
  42. *
  43. *   RESULT
  44. *       success - Was everything opened successful?
  45. *
  46. *   SEE ALSO
  47. *       TR_CloseTriton(), TR_CreateApp()
  48. *
  49. ******/
  50.  
  51. BOOL TR_OpenTriton(ULONG version, ULONG taglist,...)
  52. {
  53.   if(!(TritonBase=OpenLibrary(TRITONNAME,version))) return FALSE;
  54.   if(!(__Triton_Support_App=TR_CreateApp((struct TagItem *)&taglist))) return FALSE;
  55.   return TRUE;
  56. }
  57.  
  58.  
  59. /****** triton.lib/TR_CloseTriton ******
  60. *
  61. *   NAME        
  62. *       TR_CloseTriton -- Closes Triton easily.
  63. *
  64. *   SYNOPSIS
  65. *       TR_CloseTriton()
  66. *
  67. *       VOID TR_CloseTriton(VOID);
  68. *
  69. *   FUNCTION
  70. *       Closes the application created by OpenTriton()
  71. *       and closes triton.library.
  72. *
  73. *   SEE ALSO
  74. *       TR_OpenTriton()
  75. *
  76. ******/
  77.  
  78. void 
  79. TR_CloseTriton(void)
  80. {
  81.   if(__Triton_Support_App)
  82.   {
  83.     TR_DeleteApp(__Triton_Support_App);
  84.     __Triton_Support_App=NULL;
  85.   }
  86.   if(TritonBase)
  87.   {
  88.     CloseLibrary(TritonBase);
  89.     TritonBase=NULL;
  90.   }
  91. }
  92.  
  93. /* Stack arguments stubs */
  94.  
  95. struct TR_Project * TR_OpenProjectTags(struct TR_App *app, ULONG taglist,...)
  96.   { return TR_OpenProject(app, (struct TagItem *)&taglist); }
  97.  
  98. ULONG TR_EasyRequestTags(struct TR_App *app, STRPTR bodyfmt, STRPTR gadfmt, ULONG taglist,...)
  99.   { return TR_EasyRequest(app, bodyfmt, gadfmt, (struct TagItem *)&taglist); }
  100.  
  101. ULONG TR_AutoRequestTags(struct TR_App *app, struct TR_Project *lockproject, ULONG taglist,...)
  102.   { return TR_AutoRequest(app, lockproject, (struct TagItem *)&taglist); }
  103.  
  104.